<style lang="scss">
  @import 'index';
</style>

<template>
  <div class="ga-container">
    <div class="ga-teams">
      <h1 class="h1">我的团队（{{team.total}}人）</h1>

      <div class="ga-arrow-cell">
        <a href="../consumer/main?level=1" class="item">
          <div class="gGray">
            <span class="gaIcon dot pink"></span>
            一级消费者
          </div>
          <div class="gGraylight">
            {{team.onecount}}人
            <span class="icon-angle-right"></span></div>
        </a>
        <a href="../consumer/main?level=2" class="item">
          <span class="gGray"><span class="gaIcon dot blue"></span>二级消费者</span>
          <span class="gGraylight">{{team.twocount}}人<span class="icon-angle-right"></span></span>
        </a>
        <a href="../consumer/main?level=3" class="item">
          <span class="gGray"><span class="gaIcon dot"></span>三级消费者</span>
          <span class="gGraylight">{{team.threecount}}人<span class="icon-angle-right"></span></span>
        </a>
      </div>
    </div>
  </div>
</template>

<script>
import {isLogin} from '@/utils/handleLogin'
export default {

  data () {
    return {
       team: {}
    }
  },
  methods: {
     async load () {
         /*获取团队人数*/
          this.$_util.ajax.post('https://guo-a.com/mapi/user/userteam?token=' + this.$store.state.Token).then((res)=>{
            if(res.code === 200){
              this.team = res.data
            }
          })
     }
  },

  onShow () {
    isLogin(()=>{
      this.load()
    })
  }
}
</script>
